﻿using System;
// 抽象类相关
public abstract class UserTest
{
    public abstract void M1();
    public abstract void M2();
    public abstract void M3();
}

public class UserTestImpl : UserTest
{
    public override void M1()
    {
        Console.WriteLine("UserTestImpl 实现了 M1 方法");
    }

    public override void M2()
    {
        Console.WriteLine("UserTestImpl 实现了 M2 方法");
    }

    public override void M3()
    {
        Console.WriteLine("UserTestImpl 实现了 M3 方法");
    }
}

// 接口相关
public abstract class UserService
{
    public abstract void Add();
    public abstract void Delete();
    public abstract void Update();
    public abstract void Query();

    public void Run()
    {
        throw new NotImplementedException();
    }
}

public partial class UserServiceImpl : UserService
{
    public override void Add()
    {
        Console.WriteLine("添加数据");
    }

    public override void Delete()
    {
        Console.WriteLine("删除数据");
    }

    public override void Update()
    {
        Console.WriteLine("更新数据");
    }

    public override void Query()
    {
        Console.WriteLine("查询数据");
    }
}

// 上课练习类
public class Student
{
    public string Name { get; set; }
    public int Age { get; set; }

    public void Study()
    {
        Console.WriteLine($"{Name}正在学习");
    }
}

public class Father
{
    public string FamilyName { get; set; }

    public Father()
    {
        Console.WriteLine("Father 构造函数被调用");
    }

    public void Work()
    {
        Console.WriteLine("父亲在工作");
    }
}

public class Child : Father
{
    public Child()
    {
        Console.WriteLine("Child 构造函数被调用");
    }

    public void Play()
    {
        Console.WriteLine("孩子在玩耍");
    }
}

public class Son : Child
{
    public Son()
    {
        Console.WriteLine("Son 构造函数被调用");
    }

    public void Read()
    {
        Console.WriteLine("儿子在读书");
    }
}